package com.etone.smartAudit.task;

import com.etone.smartAudit.service.WorkOrderService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author ：张任豪
 * @date ：2022/1/14 9:15
 * @description：推送代办任务
 */
@Component
@Log4j2
public class WorkOrderTask {

    @Value("${audit.task.enable:true}")
    private Boolean enableTask;

    @Autowired
    private WorkOrderService workOrderService;

    public void pushTodo(){
        if (enableTask){
            log.info("-------------开始推送代办信息--------------");
            workOrderService.pushTodoTask();
            log.info("-----------------推送完成-------------------");
        }
    }
}
